<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>JavaScript 事件</title>
</head>
<body>
<h2>HTML 事件3</h2>
<p>事件属性调用函数</p>

<p>点击按钮来显示日期。</p>
<p id="demo"></p>

<button onclick="displayDate()">时间是？</button>

<script>
  function displayDate(){
    document.getElementById("demo").innerHTML=Date();
  }
</script>
</body>
</html>